home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / dooneevent.z / dooneevent
Text File  |  1998-10-30  |  10KB  |  133 lines

  1.  
  2.  
  3.  
  4. TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt((((3333TTTTkkkk))))                                          TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tk_DoOneEvent, Tk_MainLoop, Tk_HandleEvent - wait for events and invoke
  10.      event handlers
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
  14.  
  15.      int
  16.      TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt(_f_l_a_g_s)
  17.  
  18.      TTTTkkkk____MMMMaaaaiiiinnnnLLLLoooooooopppp()
  19.  
  20.      TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt(_e_v_e_n_t_P_t_r)
  21.  
  22. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  23.      int      _f_l_a_g_s       (in)      This parameter is normally zero.  It may
  24.                                     be an OR-ed combination of any of the
  25.                                     following flag bits:  TK_X_EVENTS,
  26.                                     TK_FILE_EVENTS, TK_TIMER_EVENTS,
  27.                                     TK_IDLE_EVENTS, TK_ALL_EVENTS, or
  28.                                     TK_DONT_WAIT.
  29.  
  30.      XEvent   *_e_v_e_n_t_P_t_r   (in)      Pointer to X event to dispatch to relevant
  31.                                     handler(s).
  32.  
  33.  
  34. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  35.      These three procedures are responsible for waiting for events and
  36.      dispatching to event handlers created with the procedures
  37.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeEEEEvvvveeeennnnttttHHHHaaaannnnddddlllleeeerrrr, TTTTkkkk____CCCCrrrreeeeaaaatttteeeeFFFFiiiilllleeeeHHHHaaaannnnddddlllleeeerrrr, TTTTkkkk____CCCCrrrreeeeaaaatttteeeeTTTTiiiimmmmeeeerrrrHHHHaaaannnnddddlllleeeerrrr, and
  38.      TTTTkkkk____DDDDooooWWWWhhhheeeennnnIIIIddddlllleeee.  TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt is the key procedure.  It waits for a
  39.      single event of any sort to occur, invokes the handler(s) for that event,
  40.      and then returns.  TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt first checks for X events and file-
  41.      related events;  if one is found then it calls the handler(s) for the
  42.      event and returns.  If there are no X or file events pending, then
  43.      TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt checks to see if timer callbacks are ready;  if so, it
  44.      makes a single callback and returns.  If no timer callbacks are ready,
  45.      TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt checks for TTTTkkkk____DDDDooooWWWWhhhheeeennnnIIIIddddlllleeee callbacks;  if any are found, it
  46.      invokes all of them and returns.  Finally, if no events or work have been
  47.      found, TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt sleeps until a timer, file, or X event occurs;  then
  48.      it processes the first event found (in the order given above) and
  49.      returns.  The normal return value is 1 to signify that some event or
  50.      callback was processed.  If no event or callback is processed (under
  51.      various conditions described below), then 0 is returned.
  52.  
  53.      If the _f_l_a_g_s argument to TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt is non-zero then it restricts the
  54.      kinds of events that will be processed by TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt.  _F_l_a_g_s may be an
  55.      OR-ed combination of any of the following bits:
  56.  
  57.      TTTTKKKK____XXXX____EEEEVVVVEEEENNNNTTTTSSSS -           Process X events.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt((((3333TTTTkkkk))))                                          TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.      TTTTKKKK____FFFFIIIILLLLEEEE____EEEEVVVVEEEENNNNTTTTSSSS -        Process file events.
  75.  
  76.      TTTTKKKK____TTTTIIIIMMMMEEEERRRR____EEEEVVVVEEEENNNNTTTTSSSS -       Process timer events.
  77.  
  78.      TTTTKKKK____IIIIDDDDLLLLEEEE____EEEEVVVVEEEENNNNTTTTSSSS -        Process TTTTkkkk____DDDDooooWWWWhhhheeeennnnIIIIddddlllleeee callbacks.
  79.  
  80.      TTTTKKKK____AAAALLLLLLLL____EEEEVVVVEEEENNNNTTTTSSSS -         Process all kinds of events:  equivalent to OR-
  81.                              ing together all of the above flags or specifying
  82.                              none of them.
  83.  
  84.      TTTTKKKK____DDDDOOOONNNNTTTT____WWWWAAAAIIIITTTT -          Don't sleep:  process only events that are ready
  85.                              at the time of the call.
  86.  
  87.      If any of the flags TTTTKKKK____XXXX____EEEEVVVVEEEENNNNTTTTSSSS, TTTTKKKK____FFFFIIIILLLLEEEE____EEEEVVVVEEEENNNNTTTTSSSS, TTTTKKKK____TTTTIIIIMMMMEEEERRRR____EEEEVVVVEEEENNNNTTTTSSSS, or
  88.      TTTTKKKK____IIIIDDDDLLLLEEEE____EEEEVVVVEEEENNNNTTTTSSSS is set, then the only events that will be considered are
  89.      those for which flags are set.  Setting none of these flags is equivalent
  90.      to the value TTTTKKKK____AAAALLLLLLLL____EEEEVVVVEEEENNNNTTTTSSSS, which causes all event types to be processed.
  91.  
  92.      The TTTTKKKK____DDDDOOOONNNNTTTT____WWWWAAAAIIIITTTT flag causes TTTTkkkk____DDDDooooWWWWhhhheeeennnnIIIIddddlllleeee not to put the process to
  93.      sleep:  it will check for events but if none are found then it returns
  94.      immediately with a return value of 0 to indicate that no work was done.
  95.      TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt will also return 0 without doing anything if _f_l_a_g_s is
  96.      TTTTKKKK____IIIIDDDDLLLLEEEE____EEEEVVVVEEEENNNNTTTTSSSS and there are no TTTTkkkk____DDDDooooWWWWhhhheeeennnnIIIIddddlllleeee callbacks pending.  Lastly,|
  97.      TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt will return 0 without doing anything if there are no events|
  98.      or work found and if there are no files, displays, or timer handlers to  |
  99.      wait for.
  100.  
  101.      TTTTkkkk____MMMMaaaaiiiinnnnLLLLoooooooopppp is a procedure that loops repeatedly calling TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt.
  102.      It returns only when there are no applications left in this process (i.e.
  103.      no main windows exist anymore).  Most X applications will call
  104.      TTTTkkkk____MMMMaaaaiiiinnnnLLLLoooooooopppp after initialization;  the main execution of the application
  105.      will consist entirely of callbacks invoked by TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt.
  106.  
  107.      TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt is a lower-level procedure invoked by TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt.  It
  108.      makes callbacks to any event handlers (created by calls to
  109.      TTTTkkkk____CCCCrrrreeeeaaaatttteeeeEEEEvvvveeeennnnttttHHHHaaaannnnddddlllleeeerrrr) that match _e_v_e_n_t_P_t_r and then returns.  In some
  110.      cases it may be useful for an application to read events directly from X
  111.      and dispatch them by calling TTTTkkkk____HHHHaaaannnnddddlllleeeeEEEEvvvveeeennnntttt, without going through the
  112.      additional mechanism provided by TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt.
  113.  
  114.      These procedures may be invoked recursively.  For example, it is possible
  115.      to invoke TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt recursively from a handler called by
  116.      TTTTkkkk____DDDDooooOOOOnnnneeeeEEEEvvvveeeennnntttt.  This sort of operation is useful in some modal
  117.      situations, such as when a notifier has been popped up and an application
  118.      wishes to wait for the user to click a button in the notifier before
  119.      doing anything else.
  120.  
  121.  
  122. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  123.      callback, event, handler, idle, timer
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.